package io;

import java.io.*;

public class CopeDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("image.jpg");
        FileOutputStream fos = new FileOutputStream("image_cp.jpg");

        long start = System.currentTimeMillis();

        int flag;
        while ((flag = fis.read()) != -1) {
            fos.write(flag);
        }
        long end = System.currentTimeMillis();
        System.out.println("复制完毕！花费时间：" + (end - start) + "ms");
        fis.close();
        fos.close();
    }
}
